import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
import { useLocale } from "@/locales"

interface IProps {
	isLabel?: boolean
}

const NameTypeSelect = ({ isLabel }: IProps) => {
	const { newFormat } = useLocale()
	const options = [
		{ label: newFormat("member.current_user_name"), value: 1 },
		{ label: newFormat("common.components.member_name"), value: 2 }
	]

	const defaultValue = options.length > 0 ? options[0].value : undefined

	return (
		<SFormItem initialValue={defaultValue} label={isLabel ? newFormat("member.name_type") : undefined} name="nameType">
			<StyleSelect
				w={250}
				defaultValue={defaultValue}
				options={options}
				placeholder={newFormat({ id: "common.please_choose" })}
			/>
		</SFormItem>
	)
}

export default NameTypeSelect
